package com.cd.system.jpa.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.cd.common.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @Description: 甘特图实体类
 * @Version: 1.0
 */
@Table(name = "lqqdb_gantt_data")
@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GanttData extends BaseEntity {
//    {
//        id: 1, text: "合同签订", start_date: "2021-01-01", duration: 1345, order: 10,
//            progress: 0.4, open: true
//    },
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "text")
    private String text;

    @Column(name = "start_date")
    private String start_date;

    @Column(name = "duration")
    private String duration;

    @Column(name = "gantt_order")
    private int order;

    @Column(name = "progress")
    private String progress;

    @Column(name = "open")
    private Boolean open;

    @Column(name = "parent")
    private int parent;

    @Column(name = "remark",length = 5000)
    private String remark;

    @Override
    public String toString() {
        return "{" +
                "id=" + id +
                ", text='" + text + '\'' +
                ", start_date='" + start_date + '\'' +
                ", duration='" + duration + '\'' +
                ", order=" + order +
                ", progress='" + progress + '\'' +
                ", open=" + open +
                ", parent=" + parent +
                ", remark='" + remark + '\'' +
                '}';
    }
}
